<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>一个简单的计数器</title>
</head>
<body>

<%! int counter = 0;
	synchronized void counterFunction() {
		counter ++;
	}
%>
<% counterFunction();%>
网站计数器<br>
你是第<%=counter %>位访问者

</body>
</html>